package cuishifeng.blog.learn.lambda.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import com.google.common.collect.Lists;

import lombok.AllArgsConstructor;
import lombok.Data;

public class StreamListDemo {

    public static void main(String[] args) {

        User user = new User();
        user.setStudents(Lists.newArrayList(new Student("hello"), new Student("hello2")));

        User user2 = new User();
        user2.setStudents(Lists.newArrayList(new Student("hello3"), new Student("hello4")));

        ArrayList<User> newArrayList = Lists.newArrayList(user, user2);
        ;
    }

    @Data
    static class User {

        private List<Student> students;
    }

    @Data
    @AllArgsConstructor
    static class Student {

        private String name;
    }

}
